<%--
  @author Supun Nimesh Karunathilaka
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<script src="${pageContext.request.contextPath}/js/print.js" type="text/javascript"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/printDetailForm.css" media="print"/>
<script type="text/javascript">
    function changeHectareTemp() {
        var he = 0, ac = 0, ro = 0, pe = 0, temp = 0;
        var cont = 2.47105381467;
        he = $("#hectareId").val();
        ac = Math.floor(he * cont);
        temp = (he * cont - ac) * 4;
        ro = Math.floor(temp);
        temp = (temp - ro) * 40;
        pe = temp.toFixed(3);
        $("#acreId").text(ac);
        $("#roodsId").text(ro);
        $("#perchesId").text(pe);
    }

    $(function () {
        var hectare = $("#hectareId").val();
        hectare = parseFloat(hectare);
        if (hectare > 0) {
            changeHectareTemp();
        }
    });

</script>
<div id="detail-land-permits-outer" class="form-outer">
    <h2><s:label value="%{getText('land_association.label')}"/> - <s:label
            value="%{getText('view_land_details.label')}"/></h2>
    <hr/>
    <s:if test="hasActionErrors() || hasActionMessages()">
    <div id="message-box" class="message-box">
        <div class="action-msg"><s:actionmessage/></div>
        <div class="action-err"><s:actionerror/></div>
    </div>
    </s:if>


    <div id="tabs">

        <div id="land-details">
            <h3><s:label value="%{getText('land_details.label')}"/></h3>
            <table class="width-100">
                <s:if test="land.mode.ordinal() == 1">
                    <tr>
                        <td><s:label value="%{getText('land_reference.label')}"/></td>
                        <td colspan="3" class="left-align"><s:property value="land.id"/></td>
                    </tr>
                </s:if>
                <tr>
                    <td><s:label value="%{getText('district.label')}"/></td>
                    <td><s:property value="districtName"/></td>
                    <td><s:label value="%{getText('ds_division.label')}"/></td>
                    <td><s:property value="dsDivisionName"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('gn_division.label')}"/></td>
                    <td><s:property value="gnDivisionName"/></td>
                    <td><s:label value="%{getText('local_authority.label')}"/></td>
                    <td><s:property value="localAuthorityName"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('village.label')}"/></td>
                    <td colspan="3"><s:property value="land.village"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('name_of_the_land.label')}"/></td>
                    <td colspan="3"><s:property value="land.nameOfTheLand"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('plan_no.label')}"/></td>
                    <td><s:property value="land.planNumber"/></td>
                    <td><s:label value="%{getText('lot_no.label')}"/></td>
                    <td><s:property value="land.lotNumber"/></td>
                </tr>
                <tr id="planServeyor">
                    <td><s:label value="%{getText('surveyor.label')}"/></td>
                    <td><s:property value="%{getText('servey_general.label')}"/></td>
                    <td><s:label value="%{getText('plan_date.label')}"/></td>
                    <td><s:property value="land.planDate"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('extent_of_the_land.label')}"/></td>
                    <td colspan="3" class="left-align"><s:label value="%{getText('hectare.label')} :"/>
                        <s:label name="hectare"/></td>
                    <s:hidden id="hectareId" name="hectare"/>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="3" class="left-align"><s:label value="%{getText('acre.label')} :"/>
                        <s:label id="acreId" name="acre"/>
                        &nbsp&nbsp&nbsp<s:label value="%{getText('roods.label')} :"/>
                        <s:label id="roodsId" name="roods"/>
                        &nbsp&nbsp&nbsp<s:label
                                value="%{getText('perches.label')} :"/> <s:label id="perchesId" name="perches"/></td>

                </tr>
                <tr>
                    <td><s:label value="%{getText('boundaries.label')}"/></td>
                    <td><s:label value="%{getText('north.label')}"/></td>
                    <td colspan="2"><s:property value="land.northBoundary"/></td>
                </tr>
                <tr>
                    <td rowspan="7"></td>
                    <td><s:label value="%{getText('north_east.label')}"/></td>
                    <td colspan="2"><s:property value="land.northEastBoundary"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('east.label')}"/></td>
                    <td colspan="2"><s:property value="land.eastBoundary"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('south_east.label')}"/></td>
                    <td colspan="2"><s:property value="land.southEastBoundary"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('south.label')}"/></td>
                    <td colspan="2"><s:property value="land.southBoundary"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('south_west.label')}"/></td>
                    <td colspan="2"><s:property value="land.southWestBoundary"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('west.label')}"/></td>
                    <td colspan="3"><s:property value="land.westBoundary"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('north_west.label')}"/></td>
                    <td colspan="3"><s:property value="land.northWestBoundary"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('geological_type.label')}"/></td>
                    <td colspan="3" class="left-align"><s:property value="geologicalType"/></td>
                </tr>
                <tr>
                    <td><s:label value="%{getText('comment_about_land.label')}"/></td>
                    <td colspan="3"><s:property value="land.landVisitComment"/></td>
                </tr>

                <s:hidden name="land.id"/>
                <s:hidden name="land.alienationState"/>
                <s:hidden name="land.approvalState"/>
                <s:hidden name="land.mode"/>
                <s:hidden name="land.parentId"/>
            </table>
            <hr/>
        </div>


    </div>
